import { deleteRequest, downPostRequest, getRequest, postRequest, putRequest, getRequestRestFul } from '@/common/config/request';
import { SYS_BASE_URL } from "@/common/constant/Const";

export const userListPaging = (data) =>{
    return postRequest(SYS_BASE_URL + "/api/user/list-paging",data);
}

export const updateUser = (data) =>{
    return postRequest(SYS_BASE_URL + "/api/user/update",data);
}

export const createUser = (data) =>{
    return postRequest(SYS_BASE_URL + "/api/user/save",data);
}

export const deleteUser = (data) =>{
    return deleteRequest(SYS_BASE_URL + "/api/user/delete",data);
}

// 用户分配角色 
export const userBindRole = (data) =>{
    return postRequest(SYS_BASE_URL + "/api/user/bindRole",data);
}

// 获取用户角色  
export const userGetRole = (data) =>{
    return getRequest(SYS_BASE_URL + "/api/user/getRole/"+data);
}

//获取路由
export const authTree = (data) =>{
    return getRequest(SYS_BASE_URL + "/api/user/authTree",data);
}